package com.ss.android.newmedia.util;

import java.util.LinkedHashMap;
import java.util.Map.Entry;

public class InfoLRUCache<K, T> extends LinkedHashMap<K, T> {
    private static final long serialVersionUID = 6166255753998387313L;
    final int mMaxSize;

    public InfoLRUCache(int maxSize, int initialCapacity) {
        super(initialCapacity, 0.75f, true);
        this.mMaxSize = maxSize;
        if (maxSize <= 0) {
            throw new IllegalArgumentException("maxSize <= 0");
        }
    }
    public boolean removeEldestEntry(Entry<K, T> entry) {
        return size() > this.mMaxSize;
    }
}

